<%= render 'base' %>
<div id="notes" class="box">
  <div class="note">
    <% if @note.publish %>
    <div class="pull-right urls">
      <em><%= t("notes.page_link")%></em> <input type="text" onclick="$(this).select();" value="<%= note_url(@note) %>" readonly="readonly" />
    </div>
    <% end %>
    <div class="info">
      <p>
        <%= raw '<span class="label warning">公开</span> ' if @note.publish %>
        共 <%= @note.word_count %> <%= t("notes.chars") %>, 由 <%= user_name_tag(@note.user) %> <%= raw t("notes.created_at", :time => timeago(@note.created_at)) %> , <%= @note.changes_count %> <%= t("notes.times_edit") %>
      </p>
    </div>

    <div class="body"><%= markdown(@note.body) %></div>
    
    <% if owner? @note %>
      <div class="buttons">
        <a href="<%= edit_note_path(@note) %>" class="btn"><%= t("common.edit")%></a>
        <%= link_to t("common.delete"), note_path(@note),:confirm => t("common.confirm_delete"), :method => :delete, :class => "btn danger"  %>
      </div>
    <% end %>
  </div>
</div>


